#ifndef AST_DECLARATIONS_STRUCT_OR_UNION_SPECIFIER_H
#define AST_DECLARATIONS_STRUCT_OR_UNION_SPECIFIER_H

#include "../ASTNode.h"
class StructOrUnion;
class sym;
class StructDeclarationList;


/*
C99  6.7.2.1
struct-or-union-specifier:
		struct-or-union    identifier(opt)    {    struct-declaration-list    }
		struct-or-union    identifier
*/
class StructOrUnionSpecifier : public ASTNode
{
protected:
	StructOrUnionSpecifier(void):
		 ASTNode(ASTNode::struct_or_union_specifier){};

public:
	StructOrUnionSpecifier(StructOrUnion *pStruct, sym * pId, StructDeclarationList *pDecList = NULL)
		: ASTNode(ASTNode::struct_or_union_specifier)
		, m_pStructOrUnion(pStruct)
		, m_pIdentifier(pId)
		, m_pDecList(pDecList) {};

	virtual ~StructOrUnionSpecifier();

	virtual void					codeGen();

protected:
	StructOrUnion *					m_pStructOrUnion;
	sym *							m_pIdentifier;
	StructDeclarationList *			m_pDecList; //may be NULL
};

#endif

